//
//  YGThirdLoginView.m
//  yuanshangyiliao
//
//  Created by icholab on 2021/3/14.
//

#import "YGThirdLoginView.h"
@interface YGThirdLoginView()
@property (nonatomic, strong) UILabel *thirdLoginLable;
@property (nonatomic, strong) UIView *leftline;
@property (nonatomic, strong) UIView *rightline;
@property (nonatomic, strong) UIButton *qqBtn;
@property (nonatomic, strong) UIButton *weChatBtn;







@end
@implementation YGThirdLoginView

#pragma private
- (instancetype)init
{
    self = [super init];
    if (self) {
        [self initView];
        [self initContraints];
    }
    return self;
}

- (void)initView{
    [self addSubview:self.thirdLoginLable];
    [self addSubview:self.leftline];
    [self addSubview:self.rightline];
    [self addSubview:self.qqBtn];
    [self addSubview:self.weChatBtn];
    
    
}

-(void) initContraints{
    [self.thirdLoginLable mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(self.mas_top);
            make.centerX.mas_equalTo(self.mas_centerX);
    }];
    
    [_leftline mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self.thirdLoginLable.mas_centerY);
        make.left.mas_equalTo(0);
        make.height.mas_equalTo(1);
        make.right.mas_equalTo(self.thirdLoginLable.mas_left).offset(-30);
    }];
    
    [_rightline mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self.thirdLoginLable.mas_centerY);
        make.right.mas_equalTo(0);
        make.height.mas_equalTo(1);
        make.left.mas_equalTo(self.thirdLoginLable.mas_right).offset(30);
    }];
    
    [_qqBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.thirdLoginLable.mas_bottom).offset(30);
        make.left.mas_equalTo(self.thirdLoginLable.mas_left).offset(-10);
    }];
    
    [_weChatBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.thirdLoginLable.mas_bottom).offset(30);
        make.right.mas_equalTo(self.thirdLoginLable.mas_right).offset(10);
    }];
    
    
}

-(void)clickThirdLoginAction{
    
}


#pragma setter
- (UILabel *)thirdLoginLable{
    if (!_thirdLoginLable) {
        _thirdLoginLable = [[UILabel alloc] init];
        _thirdLoginLable.text=@"其他账户登录";
        _thirdLoginLable.font=[UIFont systemFontOfSize:17];
        _thirdLoginLable.textColor=UIColorFromRGB(0x888888);
        _thirdLoginLable.textAlignment=NSTextAlignmentCenter;
        
    }
    return _thirdLoginLable;
}

- (UIView *)leftline{
    if (!_leftline) {
        _leftline=[[UIView alloc] init];
        _leftline.backgroundColor=UIColorFromRGB(0xf5f5f5);
    }
    return _leftline;
}

- (UIView *)rightline{
    if (!_rightline) {
        _rightline=[[UIView alloc] init];
        _rightline.backgroundColor=UIColorFromRGB(0xf5f5f5);
    }
    return _rightline;
}

- (UIButton *)qqBtn{
    if (!_qqBtn) {
        _qqBtn = [[UIButton alloc] init];
        [_qqBtn addTarget:self action:@selector(clickThirdLoginAction) forControlEvents:UIControlEventTouchUpInside];
        [_qqBtn setImage:[UIImage imageNamed:@"login_bug_qq_logo"] forState:UIControlStateNormal];
        
    }
    return _qqBtn;
}

- (UIButton *)weChatBtn{
    if (!_weChatBtn) {
        _weChatBtn = [[UIButton alloc] init];
        [_weChatBtn addTarget:self action:@selector(clickThirdLoginAction) forControlEvents:UIControlEventTouchUpInside];
        [_weChatBtn setImage:[UIImage imageNamed:@"login_bug_wechat_logo"] forState:UIControlStateNormal];
    }
    return _weChatBtn;
}
@end
